﻿using Pay.Data;
using Pay.DTO;
using Pay.IService;
using Pay.Service.Cache;
using System;
using System.Linq;

namespace Pay.Service.Service {
    public class TopicGroupService : ServiceBase, ITopicGroupService, IDisposable {
        private IUnitOfWork _iUnitOfWork;

        public TopicGroupService(IUnitOfWork iUnitOfWork)
             : base(iUnitOfWork) {
            _iUnitOfWork = iUnitOfWork;

        }
        public topic_group_dto GetTopicGroup(long TopicId) {
            return context.TopicGroups.Where(x => x.TopicId == TopicId).FromCacheFirstOrDefault<TopicGroup, topic_group_dto>("TopicGroups");
        }
    }
}
